import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, Length, IsUUID } from 'class-validator';

export class UpdateUserDto {
  @ApiProperty({
    description: '用户ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  @IsUUID()
  id: string;

  @ApiProperty({
    description: '用户名',
    example: 'john_doe',
    required: false,
  })
  @IsOptional()
  @IsString()
  @Length(3, 50)
  username?: string;

  @ApiProperty({
    description: '密码（可选，只有在需要修改密码时才提供）',
    example: 'newPassword123',
    required: false,
  })
  @IsOptional()
  @IsString()
  @Length(6, 50)
  password?: string;

  @ApiProperty({
    description: '昵称',
    example: 'John',
    required: false,
  })
  @IsOptional()
  @IsString()
  @Length(1, 50)
  nickname?: string;

  @ApiProperty({
    description: '手机号',
    example: '13800138000',
    required: false,
  })
  @IsOptional()
  @IsString()
  @Length(11, 11)
  phone?: string;
} 